package com.hqd.ch03.v27.beans.property;

import com.hqd.ch03.v27.beans.PropertyValues;
import com.hqd.ch03.v27.config.PropertyValue;

import java.util.Map;

/**
 * bean操作属性接口
 */
public interface PropertyAccessor {
    String NESTED_PROPERTY_SEPARATOR = ".";

    char NESTED_PROPERTY_SEPARATOR_CHAR = '.';

    String PROPERTY_KEY_PREFIX = "[";

    char PROPERTY_KEY_PREFIX_CHAR = '[';

    String PROPERTY_KEY_SUFFIX = "]";

    char PROPERTY_KEY_SUFFIX_CHAR = ']';


    boolean isReadableProperty(String propertyName);

    boolean isWritableProperty(String propertyName);

    Class<?> getPropertyType(String propertyName);


    Object getPropertyValue(String propertyName);

    void setPropertyValue(String propertyName, Object value);

    void setPropertyValue(PropertyValue pv);

    void setPropertyValues(Map<?, ?> map);

    void setPropertyValues(PropertyValues pvs);

    void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown);

    void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean ignoreInvalid);
}
